# 
# ADD_CUSTOM_COMMAND(
# 	OUTPUT 01-userver.sh ALL
# 	COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/01-userver.sh ${CMAKE_CURRENT_BINARY_DIR}/01-userver.sh
# 	DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/01-userver.sh
# 	)

if(ONION_EXAMPLES)
	FILE(COPY 01-userver.sh DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
	ADD_CUSTOM_TARGET(01-userver.sh ALL DEPENDS userver)

	if (PAM_ENABLED)
	if (oterm)
		FILE(COPY 02-keepalive.sh DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
		ADD_CUSTOM_TARGET(02-keepalive.sh ALL DEPENDS oterm)
	endif(oterm)
	endif (PAM_ENABLED)

	ADD_CUSTOM_TARGET(03-recorded.sh ALL DEPENDS hello ${CMAKE_CURRENT_SOURCE_DIR}/03-recorded.sh ${CMAKE_CURRENT_SOURCE_DIR}/segfault-01.txt ${CMAKE_CURRENT_SOURCE_DIR}/segfault-02.txt
		COMMAND test "${CMAKE_CURRENT_SOURCE_DIR}" = "${CMAKE_CURRENT_BINARY_DIR}" || cp ${CMAKE_CURRENT_SOURCE_DIR}/03-recorded.sh ${CMAKE_CURRENT_SOURCE_DIR}/*.txt ${CMAKE_CURRENT_BINARY_DIR}/
		)
endif(ONION_EXAMPLES)
